Skip to content

Disable implicit conversions between from Null and Nothing. #283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Dec 13, 2014

This is necessary to reject code like

 val x: Boolean = null

Without the restriction, this code would typecheck and expand to

 val x: Boolean = Predef.Boolean2boolean(null)

since null counts as a value of type java.lang.Boolean.

Closes #291. Review by @smarter

This is necessary to reject code like

     val x: Boolean = null

Without the restriction, this code would typecheck and expand to

     val x: Boolean = Predef.Boolean2boolean(null)

since `null` counts as a value of type `java.kang.Boolean`.
@smarter
Copy link
Member

smarter commented Dec 13, 2014

LGTM!

odersky added a commit that referenced this pull request Dec 13, 2014
…nforms

Disable implicit conversions between from `Null` and `Nothing`.
@odersky odersky merged commit 6542458 into scala:master Dec 13, 2014
@allanrenucci allanrenucci deleted the fix/#291-null-primitive-conforms branch December 14, 2017 19:21
tgodzik added a commit to tgodzik/scala3 that referenced this pull request Apr 29, 2025
Backport "Nowarn public implicit val class params" to 3.3 LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants